<script language="javascript">
function harusangka(jumlah){
  var karakter = (jumlah.which) ? jumlah.which : event.keyCode
  if (karakter > 31 && (karakter < 48 || karakter > 57))
    return false;

  return true;
}
</script>
<div align="center"><br>
<table width=80%><tr><td>
<ul class="nav">
<table width=80% align=center><tr><td align=center height=29><font color=#FFFFFF>Detil Toko</font></td></tr></table>
</ul></tr></table>
<?php
require_once "config/koneksi.php";
require_once "class/toko.php";
require_once "class/produk.php";

if (ISSET($_GET["id_toko"])){
$id_toko=$_GET["id_toko"];
}
$Toko_Dao = new Toko_Dao();
$toko=$Toko_Dao->get($id_toko);
$Produk_Dao = new Produk_Dao();
$produk=$Produk_Dao->get_toko($_GET['id_toko']);

echo"
<form name=form1 method=post action=view_detiltoko.php>
  </p>
  <table width=95% border=0 bordercolor=#FFFFFF align=center>
    <tr valign=middle bordercolor=#FFFFFF> 
      <td width=15% align=left></td>
      <td width=5>&nbsp;</td>
      <td width=80%><div align=left><font size=4 face=tahoma color=#0000FF>$toko->nama_toko</font></div></td>
    </tr>
    <tr bordercolor=#FFFFFF> 
      <td width=5>&nbsp;</td>
      <td width=320 valign=top nowrap><font color=#FF9900></font> 
        <div align=left> 
          <table width=100% border=0>
            <tr valign=top> 
              <td colspan=3> <hr align=right width=100% size=2 noshade color=#cccccc> 
                <font size=2 face=tahoma>$toko->deskripsi_toko</font></td>
            </tr>
            <tr valign=top> 
              <td width=50%><font size=2 face=tahoma>Alamat</font></td>
              <td width=0%>:</td>
              <td width=79%><font face=tahoma size=2>$toko->alamat</font></td>
            </tr>
            <tr valign=top> 
              <td><font size=2 face=tahoma>Kota</font></td>
              <td>:</td>
              <td><font size=2 face=tahoma>$toko->kota</font></td>
            </tr>
            <tr valign=top> 
              <td><font size=2 face=tahoma>Telepon</font></td>
              <td>:</td>
              <td><font size=2 face=tahoma>$toko->telp</font></td>
            </tr>
			<tr valign=top> 
              <td><font size=2 face=tahoma>Email</font></td>
              <td>:</td>
              <td><font size=2 face=tahoma>$toko->email</font></td>
            </tr>
          </table>
          <hr align=right width=100% size=2 noshade color=#cccccc>
          
</form>";
?>

        </div></th>
    </tr>
  </table>

</div>
<div align="center"><br>
<table width=80%><tr><td>
<ul class="nav">
<table width=80% align=center><tr><td align=center height=29><font color=#FFFFFF>Dafar Produk</font></td></tr></table>
</ul></tr></table>
<br>
<table width="50%">
<tr>
<?php
$kolom = 2;
$i=0;
foreach ($produk as $list){
if ($i >= $kolom){
echo "</tr><tr>";
$i=0;
}
    $i++;
    echo "<td align=center width=20% valign=top>
    		<div id=kotakjudul2>
            <span class=judulhead><a href='?menu=view_produkdetil&id_oleh2=".$list->id_oleh2."'>".$list->nama_oleh2."</a></span>
            </div>
            <div id=kotakisi2>
            <table border=0 width=80%><tr><td height=100 valign=top><a href='?menu=view_produkdetil&id_oleh2=$list->id_oleh2'><image src=\"images/gambar_produk/$list->gambar\"  width=\"150\" height=\"150\"></a><br /></td>
            <td width=80% valign=top>
            <font face=tahoma size=2><strong>Rp.</strong> $list->harga</font>
			<br></br>
			<input type=image border=0 name=image src=images/beli.jpg></input></tr></table></td>
			</div>";

        }
echo"</table>";
?>
</div>
</div>
</ul>
